package com.piesat.quake.business.station.api;

import com.piesat.common.vo.ResultVO;
import com.piesat.quake.business.station.service.CsnService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2022-12-21
 */
@RestController
@RequestMapping("/csn")
@Api(value = "中国地震台网", tags = "中国地震台网")
@RequiredArgsConstructor
public class CsnController {

    private final CsnService csnService;


    @ApiOperation(value = "分页按条件查询地震事件", notes = "分页按条件查询地震事件")
    @GetMapping(value = "/page")
    public ResultVO findCsnList(Integer timeType, Integer gradeType, Integer page, Integer size) throws ParseException {
        return ResultVO.success(csnService.findCsnList(timeType, gradeType, page, size));
    }

}

